import axios from "axios";
import { reactive } from "vue";

export default function useDog() {
  const dogs = reactive<string[]>([]);

  const getDog = async () => {
    try {
      const reps = await axios.get(
        "https://dog.ceo/api/breed/pembroke/images/random",
      );
      dogs.push(reps.data.message);
    } catch (e) {
      alert(e);
    }
  };

  return [dogs, getDog];
}
